home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / library / fidlib70.lha / FileID_Library / include / libraries / FileID.h < prev    next >
C/C++ Source or Header  |  1995-08-21  |  5KB  |  155 lines

  1. #ifndef LIBRARIES_FILEID_H
  2. #define LIBRARIES_FILEID_H TRUE
  3. /*
  4. **
  5. **    $VER: FileID.h 7.0
  6. **
  7. **    Standard C definitions for FileID.library
  8. **
  9. **    (C) Copyright 1993-1995 BLOODROCK of SYNDICATE
  10. **        All Rights Reserved
  11. **
  12. */
  13.  
  14. #ifndef EXEC_LIBRARIES_H
  15. #include <exec/libraries.h>
  16. #endif
  17.  
  18.  
  19. #define  FILEIDNAME     "FileID.library"
  20. #define  FILEIDVERSION  7
  21.  
  22. /*
  23. * IMPORTANT NOTE: PLEASE DO NOT USE V1.0 ! IT HAS A VERY HARD BUG ! *
  24. * ALWAYS OPEN FILEID.LIBRARY WITH VERSION == 2 OR HIGHER ! *
  25.  
  26. *
  27. * FI_FileInfo Structure *
  28. *
  29. * Note: The fields FI_DLPackNum, FI_DLPackType and FI_PackFlags are only
  30. * filled if the file type is one of the crunchers as identified by the
  31. * Decrunch.library.
  32. */
  33.  
  34. struct FI_FileInfo {
  35.    APTR  FI_Description;     /* Pointer to a file description string */
  36.    UWORD FI_ID;              /* file type ID number */
  37.    UWORD FI_GlobalFileClass; /* global file class definition */
  38.  
  39.    /* V2 fields */
  40.  
  41.    UWORD FI_DLPackNum;       /* Decrunch.library internal PackNum */
  42.    UBYTE FI_DLPackType;      /* Decrunch.library packer type */
  43.    UBYTE FI_PackFlags;       /* special flags for crunched files */
  44. };
  45.  
  46. #define ID_MAXLENGTH    35 /* Maximum file description length
  47.                             (also error messages max_length) */
  48.  
  49. /*
  50. * Global file class definitions *
  51. *
  52. * The global class definition gives you some primary information about the
  53. * global file type. This is useful if you want to know about e.g. a file
  54. * is packed.
  55. * For example, a PowerPacker password crunched executable gets a global
  56. * class value of $0007 ( EXECUTABLE|PACKED|ENCRYPTED )
  57. *
  58. * Note that on some special data formats, like e.g. IFF-ILBM files with
  59. * crunched bitmap chunks, bit 1 isn't set. If an IFF picture was packed
  60. * (e.g. using Xpk), FileID.library would report an Xpk compressed file,
  61. * not an IFF picture. Do not mischange this.
  62. * For example, NoisePacker modules or JPEG pictures DON'T have bit 1 set,
  63. * even when everybody knows that these files contain packed data. Got me ?
  64. *
  65. * FIGFC_GRAFIC_IMAGE does NOT include any 2-D or 3-D rendering data formats,
  66. * like imagine objects, vector fonts etc. Somtimes, it was really hard to
  67. * decide if this bit should be set or not. So please treat bit #5 as a kind
  68. * of help, not as warranty.
  69. */
  70.  
  71. #define  FIGFCB_EXECUTABLE    0   /* executable file */
  72. #define  FIGFCB_PACKED        1   /* file is packed/crunched */
  73. #define  FIGFCB_ENCRYPTED    2   /* encrypted file, may need a password */
  74. #define  FIGFCB_IFF_HEADER    3   /* file has "FORM" IFF header */
  75. #define  FIGFCB_MUSIC_SCORE    4   /* sound module / music score (song) */
  76. #define  FIGFCB_GRAPHIC_IMAGE    5   /* picture/brush, anim or color palette */
  77. #define  FIGFCB_FORMATTED_TEXT    6   /* special formatted text file */
  78. #define  FIGFCB_SCRIPT        7   /* script file */
  79.  
  80. #define  FIGFCF_EXECUTABLE    (1L<<0)
  81. #define  FIGFCF_PACKED        (1L<<1)
  82. #define  FIGFCF_ENCRYPTED    (1L<<2)
  83. #define  FIGFCF_IFF_HEADER    (1L<<3)
  84. #define  FIGFCF_MUSIC_SCORE    (1L<<4)
  85. #define  FIGFCF_GRAPHIC_IMAGE    (1L<<5)
  86. #define  FIGFCF_FORMATTED_TEXT    (1L<<6)
  87. #define  FIGFCF_SCRIPT        (1L<<7)
  88.  
  89.  
  90. /* FI_DLPackType */
  91.  
  92. #define        PTYP_RELOC  0        /* normal relocatible loadfile */
  93. #define        PTYP_ABS    1        /* absolute adress decruncher  */
  94. #define        PTYP_DATA   2        /* data file                   */
  95.  
  96.  
  97. /* FI_PackFlags */
  98.  
  99. #define  FIPFB_KILLSYS        0   /* file has KillSys decrunch header */
  100.  
  101.     /* V 3 */
  102.  
  103. #define  FIPFB_PPMM        1   /* crunched with PPx.x in "master mode" */
  104.  
  105.  
  106. #define  FIPFF_KILLSYS        (1L<<0)
  107.  
  108.     /* V 3 */
  109.  
  110. #define  FIPFF_PPMM        (1L<<1)
  111.  
  112.  
  113. /* FileID error codes returned by FIIdentifyFromName() */
  114.  
  115. #define  ERR_FILOCKFAILED    -1    /* couldn't get entry lock. */
  116. #define  ERR_FIEXAMINEFAILED    -2    /* couldn't examine entry. */
  117. #define  ERR_FIOPENFAILED    -3    /* couldn't open file. */
  118. #define  ERR_FIOUTOFMEM        -4    /* out of memory. */
  119. #define  ERR_FIREADERROR    -5    /* file read error. */
  120. #define  ERR_EMPTYFILE        -6    /* filesize is ZERO. */
  121. #define  ERR_NONAME        -7    /* the passed filename is empty. */
  122.  
  123.  
  124. /* Library base */
  125.  
  126. struct FileIDBase {
  127.    struct Library LibNode; /* Standard library node */
  128.  
  129.    /* LIBRARY PRIVATE */
  130.  
  131.    UBYTE FI_Flags;         /* see also: */
  132.    UBYTE FI_pad;           /* "sample.library.asm", documented in the */
  133.    ULONG FI_SegList;       /* Amiga ROM Kernel Reference Manual: Libraries */
  134.  
  135.    /* PUBLIC FIELDS *        ; may be READ from your program */
  136.  
  137.    APTR  FI_DosBase;       /* dos.library base address */
  138.  
  139.    /* V5 */
  140.  
  141. /*
  142. * If locale.library V38+ or FileID_lib.catalog couldn't be opened, the
  143. * two following fields will both contain NULL.
  144. */
  145.  
  146.    APTR  FI_LocaleBase;    /* locale.library V38+ base address */
  147.    APTR  FI_FIDCat;        /* address of the library locale catalog */
  148.  
  149.    /* V6 */
  150.  
  151.    LONG  FI_HighID;
  152. };
  153.  
  154. #endif  /* LIBRARIES_FILEID_H */
  155.